__arg; \
})
-DEFINE_PER_CPU(char, hc_preempted);
-
unsigned long hypercall_create_continuation(
unsigned int op, const char *format, ...)
{
{
regs = guest_cpu_user_regs();
regs->eax = op;
- /*
- * For PV guest, we update EIP to re-execute 'syscall' / 'int 0x82';
- * HVM does not need this since 'vmcall' / 'vmmcall' is fault-like.
- */
+
+ /* Ensure the hypercall trap instruction is re-executed. */
if ( !is_hvm_vcpu(current) )
regs->eip -= 2; /* re-execute 'syscall' / 'int 0x82' */
+ else
+ current->arch.hvm_vcpu.hcall_preempted = 1;
#ifdef __x86_64__
if ( !is_hvm_vcpu(current) ?
}
}
}
-
- this_cpu(hc_preempted) = 1;
}
va_end(args);
PFEC_page_present | pfec);
}
-#ifdef __x86_64__
-DEFINE_PER_CPU(bool_t, hvm_64bit_hcall);
-#endif
-
unsigned long copy_to_user_hvm(void *to, const void *from, unsigned int len)
{
int rc;
#ifdef __x86_64__
- if ( !this_cpu(hvm_64bit_hcall) && is_compat_arg_xlat_range(to, len) )
+ if ( !current->arch.hvm_vcpu.hcall_64bit &&
+ is_compat_arg_xlat_range(to, len) )
{
memcpy(to, from, len);
return 0;
int rc;
#ifdef __x86_64__
- if ( !this_cpu(hvm_64bit_hcall) && is_compat_arg_xlat_range(from, len) )
+ if ( !current->arch.hvm_vcpu.hcall_64bit &&
+ is_compat_arg_xlat_range(from, len) )
{
memcpy(to, from, len);
return 0;
return HVM_HCALL_completed;
}
- this_cpu(hc_preempted) = 0;
+ curr->arch.hvm_vcpu.hcall_preempted = 0;
#ifdef __x86_64__
if ( mode == 8 )
HVM_DBG_LOG(DBG_LEVEL_HCALL, "hcall%u(%lx, %lx, %lx, %lx, %lx)", eax,
regs->rdi, regs->rsi, regs->rdx, regs->r10, regs->r8);
- this_cpu(hvm_64bit_hcall) = 1;
+ curr->arch.hvm_vcpu.hcall_64bit = 1;
regs->rax = hvm_hypercall64_table[eax](regs->rdi,
regs->rsi,
regs->rdx,
regs->r10,
regs->r8);
- this_cpu(hvm_64bit_hcall) = 0;
+ curr->arch.hvm_vcpu.hcall_64bit = 0;
}
else
#endif
HVM_DBG_LOG(DBG_LEVEL_HCALL, "hcall%u -> %lx",
eax, (unsigned long)regs->eax);
- if ( this_cpu(hc_preempted) )
+ if ( curr->arch.hvm_vcpu.hcall_preempted )
return HVM_HCALL_preempted;
if ( unlikely(curr->domain->arch.hvm_domain.qemu_mapcache_invalidate) &&
#ifndef __ASM_X86_HVM_GUEST_ACCESS_H__
#define __ASM_X86_HVM_GUEST_ACCESS_H__
-#include <xen/percpu.h>
-DECLARE_PER_CPU(bool_t, hvm_64bit_hcall);
-
unsigned long copy_to_user_hvm(void *to, const void *from, unsigned len);
unsigned long copy_from_user_hvm(void *to, const void *from, unsigned len);
*/
#define MMU_UPDATE_PREEMPTED (~(~0U>>1))
-/*
- * This gets set to a non-zero value whenever hypercall_create_continuation()
- * is used (outside of multicall context; in multicall context the second call
- * from do_multicall() itself will have this effect). Internal callers of
- * hypercall handlers interested in this condition must clear the flag prior
- * to invoking the respective handler(s).
- */
-DECLARE_PER_CPU(char, hc_preempted);
-
extern long
do_event_channel_op_compat(
XEN_GUEST_HANDLE(evtchn_op_t) uop);